<?php

namespace addons\qingdongams\controller;


/**
 * 附件接口
 */
class File extends StaffApi {
	protected $noNeedLogin = [];
	protected $noNeedRight = [];


	//修改附件附件
	public function editName() {
		$id        = input("id", 0);
		$name      = input('name', '');
		$filemodel = new \addons\qingdongams\model\File();
		$row       = $filemodel->get($id);
		if (empty($row)) {
			$this->error('附件不存在');
		}
		if ($row->save(['name' => $name])) {
			$this->success('修改成功');
		} else {
			$this->error('修改失败');
		}
	}
}
